<ion-view hide-back-button="true" title="我的地址" cache-view="false">
  <ion-nav-buttons side="left">
    <a class="button button-clear" ng-click="goBack()">
      <i class="icon ion-chevron-left"></i>
    </a>
  </ion-nav-buttons>
  <ion-nav-buttons side="right">
    <a class="button button-clear" ui-sref="mine.address.add">
      <i class="icon ion-ios-plus-outline"></i>
    </a>
  </ion-nav-buttons>
  <ion-content>
    <p ng-if="!addresses || addresses.length <= 0" style="text-align: center">地址为空，请点击右上角按钮添加</p>
    <ul class="list addr-list">
      <div ng-repeat="addr in addresses| orderBy: -addr.default">
        <li class="item row" ng-click="selectLoc(addr)">
          <div class="col col-66">
            {{addr.receivename}}
            <br>
            <span style="font-size: 13px">{{addr.detail}}</span>
          </div>
          <div class="col col-33" ng-show="addr.default == 1 && !edit" style="text-align: center">
            默认
            <br>
            <img alt="" src="img/hd/icon_choose.png" style="width: 18px; padding-top: 5px">
          </div>
          <div class="col col-33" ng-click="setDefault(addr); $event.stopPropagation()" ng-show="addr.default == 0 && !edit" style="text-align: center">
            设为默认
            <br>
            <img alt="" src="img/hd/icon_unchoose.png" style="width: 18px; padding-top: 5px">
          </div>
          <button class="col main-background" ng-click="deleteAddr(addr); $event.stopPropagation()" ng-show="edit" style="width: 100%; text-align: center; padding-top: 5px;border:0px">
            刪除
          </button>
        </li>
        <li class="divider"></li>
      </div>
      <button class="button button-block main-background" ng-click="edit = !edit" style="border-radius: 10px">
        <span ng-show="edit">取消</span>
        <span ng-show="!edit">编辑</span>
      </button>
    </ul>
  </ion-content>
</ion-view>
